package com.serkol.ams.vo;

import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.Data;

import java.util.List;

@Data
public class MyPage<T> {

    private long total;
    private List<T> data;
    private long current;
    private long size;
    private long pages;

    public static MyPage parsePage(IPage page) {
        MyPage myPage = new MyPage();
        myPage.setTotal(page.getTotal());
        myPage.setData(page.getRecords());
        myPage.setCurrent(page.getCurrent());
        myPage.setSize(page.getSize());
        myPage.setPages(page.getPages());
        return myPage;
    }

}
